package com.igs.muziapp;

import com.igs.muziapp.camera.CameraScaner;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.Toast;
import android.widget.ViewFlipper;
import net.sourceforge.zbar.Symbol;

public class MuziApp extends Activity {

	private Button Btn_Register;
	private Button Btn_Login;
	private static final int ZBAR_SCANNER_REQUEST = 0;
	private static final int ZBAR_QR_SCANNER_REQUEST = 1;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_muzi_app);

		// mViewFliper.addView(child);

		// 創建帳號
		Btn_Register = (Button) findViewById(R.id.btn_register);
		Btn_Register.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				// startActivity(new Intent(MuziApp.this,
				// RegisterClause.class));
				// startActivity(new Intent(MuziApp.this,
				// AppPreferences.class));

				// Intent intent = new
				// Intent("com.google.zxing.client.android.SCAN");
				// intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
				// startActivityForResult(intent, 1);

				startActivity(new Intent(MuziApp.this, CameraScaner.class));

			}
		});

		Btn_Login = (Button) findViewById(R.id.btn_login);
		Btn_Login.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startActivity(new Intent(MuziApp.this, MuziMain.class));
			}
		});

	}

	public boolean isCameraAvailable() {
		PackageManager pm = getPackageManager();
		return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_muzi_app, menu);
		return true;
	}

}
